package com.shuqi.controller;

import android.content.Context;

import com.shuqi.activity.BookCatalogActivity;
import com.shuqi.interfaces.IEventListener;
import com.shuqi.model.BookCatalogModel;

/**
 * 目录页控制器
 * 
 * @author yanghuawei
 */
public class BookCatalogController extends ControllerBase {
    private BookCatalogActivity mContext;
    private BookCatalogModel model;

    public BookCatalogController(Context context) {
        this.mContext = (BookCatalogActivity) context;
        model = new BookCatalogModel(context);
    }

    @Override
    public void addEventListener(IEventListener listener) {
        model.addEventListener(listener);
    }

    @Override
    public void handle(int eventType, Object... objs) {
        switch (eventType) {
            case EVENT_LOADPAGE:
                model.loadData(objs);
                break;

            default:
                break;
        }
    }

    @Override
    public void onDestroy() {
        model.onDestroy();
    }

}
